package com.coffee.core.enums;

public enum SkuSalesInformationTypeEnum {
    GENERAL("general", "普通商品"),
    PERIODIZATION("periodization", "分期购");

    private String code;
    private String name;

    private SkuSalesInformationTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static SkuSalesInformationTypeEnum getByCode(String code) {
        for (SkuSalesInformationTypeEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}
